package com.ruoyi.web.core.config;

import com.github.wxpay.sdk.WXPayConfig;
import lombok.extern.slf4j.Slf4j;

import java.io.IOException;

/**
 * 天蛙小程序  有电创新新商户收款配置
 */
@Slf4j
public class YdcxxConfig extends WechatConfig{
    /**
     * 天蛙小程序appId
     */
    public static final String APPID = "wxd602e0793295cc28";

    /**
     * 天蛙小程序密钥
     */
    public static final String SECRET = "7ec0b59e73b75b7388bd0323f1d29955";

    /**
     * 有电创新新商户号
     */
    public static final String MCHID = "1607391587";

    /**
     * 有电创新新商户密钥 --- 同 API V3 密钥
     */
    public static final String KEY = "b314ac4e775bd34c7b327db6050c90fe";

    /**
     * 有电创新新 API V3 秘钥
     */
    public static final String API_V3_KEY = "b314ac4e775bd34c7b327db6050c90fe";


    public static final String BODY = "智能物联";

    public static final  String DESC = "智能物联分润到账";

    /**
     * 有电创新新商户支付分充电宝服务号
     */
    public static final String SERVICE_ID = "00002000000000161579680157896583";

    /**
     * 支付分签名方式
     */
    public static final String SIGN_TYPE = "HMAC-SHA256";

    /**
     * 金额环回说明
     */
    public static final String REFUND_DESC = "智能物联，余额退还";

    /**
     * 有电创新新商户api证书序列号
     * https://myssl.com/cert_decode.html 证书解析地址
     */
    public static final String SERIAL_NO = "4B1EA3BE6B466BA78B68EF68893B9568A7041AC9";

    /**
     * 有电创新新证书内容  apiclient_key.pem文件中的内容 除去开头结尾行
     *  请求量大为节约资源直接拿出来
     */
    public static final String PRIVATE_CONTENT = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCm7zEy/+iFvBlo" +
            "40HQUc5W8KDW2vXFzSkLRQB82glzQA4y94VWhGYtgWZFytsp5nI5BlopZb7haott" +
            "F8xkb6UNkYHTXBzWJU62FTpIbni0D1SlvRNKtd5cPDINk/Tg0jt3C1Mb3/guJHf3" +
            "UWRWSlxXQwfJpliSsXOcgHSjqGq63QAtDlvFWhvB+n70Yde6qTzcbrDd8lt21+n5" +
            "rJs1UR9Zd5HCmYhvaHLRPmmuUH+fsd3qiF9NHSP/+dzf4RaFV9+OxPQ5JkgKGn62" +
            "m6rTFt0GRelJ6KiE4BOjTt82EGoQ6KLxGCmCyPImM2/PhW3LvnYrDDg1moJCJgfb" +
            "u1Q2XS+7AgMBAAECggEAVO7d2VTauTA6vWLi2VrF4PYM30QIR9taRqGU3fERXdH5" +
            "Z3UIIjy6v+xWXKwZVfgppVnWBbn+pDHRPnAdTfx/vaeKpj73bP0OTxX90VxjjTk/" +
            "mBPa/OgLemImFUJyFPDh0G+ymTwayV9EqlB+/GhZEwzHqZE4/2nJqJaywZGuu+Ni" +
            "8uSKixmzWGHdQMc4Yk96HHpyUccvpf9IZHnRaY8OW644X/np/4LH1pEWtFqnkIPT" +
            "mpmGwl48J6Rz4OukIWyEZv9zPteehJtgvLfm63z6RtXng2KCoMClcMn5iiSABdl+" +
            "dr4xeUlE7JsXITWb8J5v3tmK5YRzobBfJgCkzsPsAQKBgQDWgqHlWLEmambE7h5+" +
            "HLJ5QrCOlU0EwaWVAClL93HdnSQlmthCO3lo2+956sTEnmdk6UTtDcfUdyKmRs1b" +
            "6zhC7nxxppTulSLggx5mQGKuMa0l/xLCpSl4qJ8cEfTHENIRGh7nLpCvtTOIRC+k" +
            "NZaDA7R8xcyuZJfqCZyjYd6O2QKBgQDHONyDU1J9jnJkwLNu6wwqcwNNbgoOnzdh" +
            "eb3b/b7jjqfIbCjgDMW1P83aGiNY5HVvb3k9dRlgMhxIvLRdollNXetw5YZQZUpf" +
            "Hyd/Q89oyDA89MUlPBB6K3V03CNrpH+wLfh1fwI5LulF6hIAU1+3Om7/QIPuGzDA" +
            "SkJ6K6T+swKBgE4H9xyWxtpSmk/Izw7RIZs6xz8W0I2KY9Fv3ZXkzWbwYtXLHh/5" +
            "wpCCcPrIjAt6E+KBeLFC8g43yEL0Pn/RcQXn+xzcnBCt76H8EHLhuQPkzjekMg7c" +
            "Rdm+fSKY5ZIEbGYMOnGeXsOMBtLq+umhFL9T+bPpwCswLJLWLETCtVMBAoGAUyk0" +
            "O4mjjI/SxqX+ANYTHQEnpsHBZvslZgYor9VLQrhA55PmuCf8u70nk9yHVsr/DoZM" +
            "6M+hyRsB3YcQD2n+tyH2bwkQuSyfD/f0R9aplMbEBB300acyBZ1wiVh/XKatOoDm" +
            "Dz32UqJ3c9zSqNokwVqeDOUEbXdiMVKOT2s6k6sCgYEAthP3uGgP2mtFN+sPIvR9" +
            "8KNDzXYlmYnrcWPz8qN82fa9A8QKBOwr9UsFzgZKfeTY5+9SNLELcrdxxIXkZll2" +
            "8RxciAdQjq7Emk36NvF9lTQlSeoitx8uXAXsB8i1ps3lemFXIpUCZHlw6uws0TDJ" +
            "c7/5cIGvQrglTqDVXJdsuBs=";

    @Override
    public String getAppid() {
        return APPID;
    }

    @Override
    public String getSecret() {
        return SECRET;
    }

    @Override
    public String getMchId() {
        return MCHID;
    }

    @Override
    public String getKey() {
        return KEY;
    }

    @Override
    public String getApiV3Key() {
        return API_V3_KEY;
    }

    @Override
    public String getBody() {
        return BODY;
    }

    @Override
    public String getDesc() {
        return DESC;
    }

    @Override
    public String getServiceId() {
        return SERVICE_ID;
    }

    @Override
    public String getSignType() {
        return SIGN_TYPE;
    }

    @Override
    public String getRefundDesc() {
        return REFUND_DESC;
    }

    @Override
    public String getSerialNo() {
        return SERIAL_NO;
    }

    @Override
    public String getPrivateContent() {
        return PRIVATE_CONTENT;
    }

    @Override
    public WXPayConfig getWXPayConfig() {
        try {
            return new YdcxxPayConfig();
        } catch (IOException e) {
            log.error("【error】：有电创新新商户配置文件初始化失败" +e.getMessage(), e);
        }
        return null;
    }
}
